const express = require('express')
var bodyParser = require('body-parser');
const app = express()

// 给app挂载一个加密规则密文串
app.set('secret','hahahahahaha')
app.use(require('cors')())
app.use(express.json())
app.use(bodyParser.json({limit: '1mb'}));  //body-parser 解析json格式数据
app.use(bodyParser.urlencoded({            //此项必须在 bodyParser.json 下面,为参数编码
  extended: true
}));
// 可以匹配到'/uploads'   就可以访问到这个文件下的东西
app.use('/uploads',express.static(__dirname+'/uploads'))

require('./plugins/db')(app)
require('./routes/charity/index')(app)
require('./routes/admin/index')(app)
// require('./routes/web/index')(app)


app.listen(3000,()=>{
    console.log('http://localhost:3000')
})








